package com.scholarship.modules.admin.service;

import com.github.pagehelper.PageInfo;
import com.scholarship.modules.admin.dto.QueryDto;
import com.scholarship.common.dto.ResultListDto;
import com.scholarship.modules.admin.dto.StudentInfoListDto;
import com.scholarship.modules.admin.dto.StudentQueryDto;
import com.scholarship.modules.admin.entity.UserInfo;
import com.scholarship.modules.admin.exce.UpdateFailedException;
import org.springframework.http.ResponseEntity;

import java.util.List;
import java.util.Map;

/**
 * 学生信息管理业务
 * @Author Z.J.H
 * @create 2021/4/14 14:23
 */
public interface StudentInfoListService {

    /**
     * 获取学生管理列表查询条件
     * @return
     * @throws Exception
     */
    Map<String, List<String>> getStudentQuery() throws Exception;

    /**
     * 查询所有学生信息
     * @return
     * @throws Exception
     */
    ResultListDto<StudentInfoListDto> listAllStudentInfo(Integer pageNum, Integer pageSize) throws Exception;

    /**
     * 根据查询条件查询学生信息
     * @param studentQueryDto
     * @return
     * @throws Exception
     */
    ResultListDto<StudentInfoListDto> listStudentInfoByQuery(Integer pageNum,Integer pageSize,StudentQueryDto studentQueryDto) throws Exception;

    /**
     * 根据搜索查询学生信息
     * @param searchStr
     * @return
     * @throws Exception
     */
    ResultListDto<StudentInfoListDto> listStudentInfoBySearch(Integer pageNum,Integer pageSize,String searchStr) throws Exception;

    /**
     * 修改用户密码
     * @param userId
     * @param newPwd
     * @throws Exception
     */
    void changeUserPwd(String userId,String newPwd) throws Exception;

    /**
     * 添加学生信息
     * @param userInfo
     * @throws Exception
     */
    Boolean addStudentInfo(UserInfo userInfo) throws Exception;

    /**
     * 获得学生信息
     * @param userId
     * @return
     * @throws Exception
     */
    UserInfo getStudentInfo(String userId) throws Exception;

    /**
     * 更新学生信息
     * @param userInfo
     * @throws Exception
     */
    void updateStudentInfo(UserInfo userInfo) throws Exception;

    /**
     * 冻结用户账号
     * @param userId
     */
    void frozenUserAccent(String userId) throws UpdateFailedException;

    /**
     * 激活用户账号
     * @param userId
     * @throws UpdateFailedException
     */
    void activateUserAccent(String userId) throws UpdateFailedException;

    /**
     * 删除学生全部信息
     * @param userId
     */
    void deleteUser(String userId) throws Exception;

    /**
     * 根据学年专业更新加权平均分排名
     * @param year
     * @param major
     * @throws Exception
     */
    Boolean updateRankByYearMajor(String year,String major) throws Exception;

    /**
     * 更新全阶段加权平均分排名
     * @throws Exception
     */
    void updateAllRank() throws Exception;
}
